import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class BottomConfirmBar extends StatelessWidget {
  final String? leftText;
  final String? rightText;
  final GestureTapCallback? onTapLeft;
  final GestureTapCallback? onTapRight;
  const BottomConfirmBar(
      {super.key,
      this.leftText,
      this.rightText,
      this.onTapLeft,
      this.onTapRight});

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.only(top: 6.h, bottom: 8.h),
      color: Colors.white,
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
        children: [
          Flexible(
            flex: 1,
            child: TextButton(
              onPressed: onTapLeft,
              child: Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  Image(
                      width: 40.w,
                      height: 40.h,
                      fit: BoxFit.fill,
                      image: const AssetImage(
                          "assets/images/icon_bottom_sheet_cancel.png")),
                  SizedBox(
                    width: 18.w,
                  ),
                  Text(leftText ?? "",
                      style: TextStyle(
                          fontSize: 32.sp, color: const Color(0xFF6D6D6D)))
                ],
              ),
            ),
          ),
          Container(
            color: const Color(0xFFD8D8D8),
            width: 2.w,
            height: 32.h,
          ),
          Flexible(
            flex: 1,
            child: TextButton(
              onPressed: onTapRight,
              child: Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  Image(
                      width: 40.w,
                      height: 40.h,
                      fit: BoxFit.fill,
                      image: const AssetImage(
                          "assets/images/icon_bottom_sheet_confirm.png")),
                  SizedBox(
                    width: 18.w,
                  ),
                  Text(
                    rightText ?? "",
                    style: TextStyle(
                        fontSize: 32.sp, color: const Color(0xFF1774E0)),
                  )
                ],
              ),
            ),
          ),
        ],
      ),
    );
  }
}
